package com.coded2.mobileposto.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * The primary key class for the posto_combustivel database table.
 * 
 */
@Embeddable
public class PostoCombustivelPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_combustivel", insertable=false, updatable=false)
	private int idCombustivel;

	@Column(name="id_posto", insertable=false, updatable=false)
	private int idPosto;

	public PostoCombustivelPK() {
	}
	public int getIdCombustivel() {
		return this.idCombustivel;
	}
	public void setIdCombustivel(int idCombustivel) {
		this.idCombustivel = idCombustivel;
	}
	public int getIdPosto() {
		return this.idPosto;
	}
	public void setIdPosto(int idPosto) {
		this.idPosto = idPosto;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PostoCombustivelPK)) {
			return false;
		}
		PostoCombustivelPK castOther = (PostoCombustivelPK)other;
		return 
			(this.idCombustivel == castOther.idCombustivel)
			&& (this.idPosto == castOther.idPosto);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idCombustivel;
		hash = hash * prime + this.idPosto;
		
		return hash;
	}
}